<title>资质审查-完善资质信息</title>
<!-- /section:settings.box -->
<div class="row">
	<div class="col-xs-12 aptitude_list_qualification">
		<form class="form-horizontal registerform">
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">证书号：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						
						<input type="text" class="input-xlarge" datatype="*" value="<?=$model['certificate_no']?>" id="hx_certificate_no"
							nullmsg="请输入证书号" placeholder="请输入证书号">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">证书发证时间：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<div class="form_so input-group date form_datetime input-xlarge"
							data-date-format="yyyy-mm-dd hh:ii:00"
							data-link-field="dtp_input1">
							<input class="form-control" size="16" type="text" datatype="*" id="hx_certificate_time" value="<?=(strtotime($model['certificate_time']))?date('Y-m-d',strtotime($model['certificate_time'])):""?>"
								nullmsg="请输入证书发证时间" placeholder="请输入证书发证时间"> <span
								class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
						</div>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">证书到期时间：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<div class="form_so input-group date form_datetime input-xlarge"
							data-date-format="yyyy-mm-dd hh:ii:00"
							data-link-field="dtp_input1">							
							<input class="form-control" size="16" type="text" datatype="*" id="hx_maturity_time" value="<?=(strtotime($model['maturity_time']))?date('Y-m-d',strtotime($model['maturity_time'])):""?>"
								nullmsg="请输入证书到期时间" placeholder="请输入证书到期时间"> <span
								class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
						</div>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="clearfix form-actions">
				<div class="col-md-offset-3 col-md-9">
					<button class="btn btn-info save" type="button" id="btnSubmit">
						<i class="ace-icon fa fa-check bigger-110"></i>提交
					</button>
					&nbsp; &nbsp;
					<button class="btn" type="button">
						<i class="ace-icon glyphicon glyphicon-remove bigger-110"></i>取消
					</button>
				</div>
			</div>
		</form>
	</div>
	<!-- PAGE CONTENT ENDS -->
	<!-- /.col -->
</div>
<script type="text/javascript">
var scripts=[
	null,
	"/datetimepicker/js/bootstrap-datetimepicker.min.js",
	"/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js",
	null
];
var $scope = $(".aptitude_list_qualification");
$('.page-content-area').ace_ajax('loadScripts', scripts, function(){
	//表单验证
	var vform=$(".registerform").Validform({
		tiptype:2
	});
	//日期选择器
	$('.form_datetime').datetimepicker({
		minView: "month", //选择日期后，不会再跳转去选择时分秒 
		format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式 
		language: 'zh-CN', //汉化 
		autoclose:true //选择日期后自动关闭 
	});
	$('#btnSubmit').click(function() {
		if (!vform.check(false)) {
			return;
		}
		var certificate_no = $("#hx_certificate_no", $scope).val();
		var certificate_time = $("#hx_certificate_time", $scope).val();
		var maturity_time = $("#hx_maturity_time", $scope).val();
		$.post('/aptitude/ajax_receipt_zsdj', {
			'id': '<?=$id?>',
			'ty':'<?=$ty?>',
			'certificate_no': certificate_no,
			'certificate_time': certificate_time,
			'maturity_time': maturity_time
		}, function(data) {
			if (200 === data.status) {
				message_box.show(data.data);
				gDialog.fClose();
				if (typeof(pageObj) != "undefined") {
					if (data.page < pageObj.get_page_count()) {
						pageObj.dec_page_count(); //-1
						if (pageObj.get_page_index() > pageObj.get_page_count()) {
							pageObj.go_page(pageObj.get_page_count());
						} else {
							pageObj.cur_page();
						}
					} else {
						pageObj.cur_page();
					}
				}
			} else {
				message_box.show(data.data);
			}
		}, 'json');
		//console.log(form_data)
	})
})
</script>
